// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_REP_REGISTER_ITEM
// * CreateDate    : 2012-1-4 14:00:31
// * Creater       : CodeSmith
// * LastChangeDate: 2012-1-4 14:00:31
// * LastChanger   : 2012-1-4 14:00:31
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class RepRegisterItemEntity : EntityBase
    {
        public RepRegisterItemTable TableSchema
        {
            get
            {
                return RepRegisterItemTable.Current;
            }
        }

        public RepRegisterItemEntity()
        {

        }

        public RepRegisterItemEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.RegisterItemId = Convert.ToString(CommonFunctions.ToObject(dr["REGISTER_ITEM_ID"]));
            this.RegisterId = Convert.ToString(CommonFunctions.ToObject(dr["REGISTER_ID"]));
            this.ContactId = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_ID"]));
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.ProductSpecIn = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_IN"]));
            this.ProductSpecOut = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_OUT"]));
            this.Material = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL"]));
            this.DiameterOut = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_OUT"]));
            this.DiameterIn = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_IN"]));
            this.Length = Convert.ToDecimal(CommonFunctions.ToObject(dr["LENGTH"]));
            this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
            this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
            this.Price = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE"]));
            this.TaxRate = Convert.ToDecimal(CommonFunctions.ToObject(dr["TAX_RATE"]));
            this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
            this.LocationCode = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_CODE"]));
            this.IsPacking = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_PACKING"]));
            this.BlueprintDeliveryDatetime = Convert.ToDateTime(CommonFunctions.ToObject(dr["BLUEPRINT_DELIVERY_DATETIME"]));
        }

        public RepRegisterItemEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.RegisterItemId = Convert.ToString(CommonFunctions.ToObject(dr["REGISTER_ITEM_ID"]));
            this.RegisterId = Convert.ToString(CommonFunctions.ToObject(dr["REGISTER_ID"]));
            this.ContactId = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_ID"]));
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.ProductSpecIn = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_IN"]));
            this.ProductSpecOut = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_OUT"]));
            this.Material = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL"]));
            this.DiameterOut = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_OUT"]));
            this.DiameterIn = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_IN"]));
            this.Length = Convert.ToDecimal(CommonFunctions.ToObject(dr["LENGTH"]));
            this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
            this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
            this.Price = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE"]));
            this.TaxRate = Convert.ToDecimal(CommonFunctions.ToObject(dr["TAX_RATE"]));
            this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
            this.LocationCode = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_CODE"]));
            this.IsPacking = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_PACKING"]));
            this.BlueprintDeliveryDatetime = Convert.ToDateTime(CommonFunctions.ToObject(dr["BLUEPRINT_DELIVERY_DATETIME"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return RepRegisterItemTable.Current;
            }
        }

        #region Perporty List
        public string RegisterItemId
        {
            get { return Convert.ToString(GetData(RepRegisterItemTable.C_REGISTER_ITEM_ID)); }
            set { SetData(RepRegisterItemTable.C_REGISTER_ITEM_ID, value); }
        }

        public string RegisterId
        {
            get { return Convert.ToString(GetData(RepRegisterItemTable.C_REGISTER_ID)); }
            set { SetData(RepRegisterItemTable.C_REGISTER_ID, value); }
        }

        public string ContactId
        {
            get { return Convert.ToString(GetData(RepRegisterItemTable.C_CONTACT_ID)); }
            set { SetData(RepRegisterItemTable.C_CONTACT_ID, value); }
        }

        public string ProductId
        {
            get { return Convert.ToString(GetData(RepRegisterItemTable.C_PRODUCT_ID)); }
            set { SetData(RepRegisterItemTable.C_PRODUCT_ID, value); }
        }

        public string ProductSpecIn
        {
            get { return Convert.ToString(GetData(RepRegisterItemTable.C_PRODUCT_SPEC_IN)); }
            set { SetData(RepRegisterItemTable.C_PRODUCT_SPEC_IN, value); }
        }

        public string ProductSpecOut
        {
            get { return Convert.ToString(GetData(RepRegisterItemTable.C_PRODUCT_SPEC_OUT)); }
            set { SetData(RepRegisterItemTable.C_PRODUCT_SPEC_OUT, value); }
        }

        public string Material
        {
            get { return Convert.ToString(GetData(RepRegisterItemTable.C_MATERIAL)); }
            set { SetData(RepRegisterItemTable.C_MATERIAL, value); }
        }

        public decimal DiameterOut
        {
            get { return Convert.ToDecimal(GetData(RepRegisterItemTable.C_DIAMETER_OUT)); }
            set { SetData(RepRegisterItemTable.C_DIAMETER_OUT, value); }
        }

        public decimal DiameterIn
        {
            get { return Convert.ToDecimal(GetData(RepRegisterItemTable.C_DIAMETER_IN)); }
            set { SetData(RepRegisterItemTable.C_DIAMETER_IN, value); }
        }

        public decimal Length
        {
            get { return Convert.ToDecimal(GetData(RepRegisterItemTable.C_LENGTH)); }
            set { SetData(RepRegisterItemTable.C_LENGTH, value); }
        }

        public string Unit
        {
            get { return Convert.ToString(GetData(RepRegisterItemTable.C_UNIT)); }
            set { SetData(RepRegisterItemTable.C_UNIT, value); }
        }

        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(RepRegisterItemTable.C_QTY)); }
            set { SetData(RepRegisterItemTable.C_QTY, value); }
        }

        public decimal Price
        {
            get { return Convert.ToDecimal(GetData(RepRegisterItemTable.C_PRICE)); }
            set { SetData(RepRegisterItemTable.C_PRICE, value); }
        }

        public decimal TaxRate
        {
            get { return Convert.ToDecimal(GetData(RepRegisterItemTable.C_TAX_RATE)); }
            set { SetData(RepRegisterItemTable.C_TAX_RATE, value); }
        }

        public string Remark
        {
            get { return Convert.ToString(GetData(RepRegisterItemTable.C_REMARK)); }
            set { SetData(RepRegisterItemTable.C_REMARK, value); }
        }

        public string LocationCode
        {
            get { return Convert.ToString(GetData(RepRegisterItemTable.C_LOCATION_CODE)); }
            set { SetData(RepRegisterItemTable.C_LOCATION_CODE, value); }
        }

        public int IsPacking
        {
            get { return Convert.ToInt32(GetData(RepRegisterItemTable.C_IS_PACKING)); }
            set { SetData(RepRegisterItemTable.C_IS_PACKING, value); }
        }

        public DateTime BlueprintDeliveryDatetime
        {
            get { return Convert.ToDateTime(GetData(RepRegisterItemTable.C_BLUEPRINT_DELIVERY_DATETIME)); }
            set { SetData(RepRegisterItemTable.C_BLUEPRINT_DELIVERY_DATETIME, value); }
        }

        #endregion
    }


}

